<script>
	export default {
		onLaunch: function() {
			//console.log('App Launch')
			//#ifdef APP-PLUS
			let info = plus.push.getClientInfo()
			console.log(info)
			// 使用5+App的方式进行监听消息推送
			plus.push.addEventListener("click", function(msg) {
				console.log("click:" + JSON.stringify(msg));
				uni.switchTab({
					url:"/pages/tabbar/msg"
				})
			}, false);
			// 监听在线消息事件    
			plus.push.addEventListener("receive", function(msg) {
				//业务代码
				console.log("recevice:" + JSON.stringify(msg))
				//如果是在线收到推送消息，需要创建一条推送  cover: false 是否覆盖上一条推送消息
				var options = { cover: false, title: msg.payload.title }
				plus.push.createMessage(msg.payload.content, "", options)
				
			}, false);
			//#endif
		},
		onShow: function() {
			//console.log('App Show')
		},
		onHide: function() {
			//console.log('App Hide')
		},
		onUnload(){
			console.log('App onUnload')
			uni.clearStorageSync()
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>

<style lang="scss">
@import "uview-ui/index.scss";

.page-container{
	width: 100vw;
	height: calc(100vh - 44px);
	padding: 20rpx;
	box-sizing: border-box;
}
</style>

